package com.latefly.skewwork.ui.page

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.latefly.skewwork.ui.page.home.HomePage
import com.latefly.skewwork.ui.page.login.LoginPage
import com.latefly.skewwork.ui.page.login.register.BackToLogin
import com.latefly.skewwork.ui.page.login.register.Information
import com.latefly.skewwork.ui.page.login.register.Verify
import com.latefly.skewwork.ui.page.practice.TestPage
import com.latefly.skewwork.ui.page.resource.ResourcePage
import com.latefly.skewwork.ui.page.self.SelfPage
import com.latefly.skewwork.ui.page.self.setting.Setting
import com.latefly.skewwork.ui.page.tools.ToolsPage
import com.latefly.skewwork.ui.page.tools.ble.Ble
import com.latefly.skewwork.ui.page.tools.calculator.CalculatorPage
import com.latefly.skewwork.ui.page.tools.todo.ToDoList


@Composable
fun AppNavigation(
    pageViewModels: PageViewModels,
) {
    val navController = rememberNavController()
    NavHost(navController = navController, startDestination = "Home") {
        /******************Login*****************/
        composable("Login") {
            LoginPage(navController, Modifier)
        }
        composable("Login/Register") {
            Information(navController)
        }
        composable("Login/Verify") {
            Verify(navController)
        }
        composable("Login/BackToLogin") {
            BackToLogin(navController)
        }


        /******************Home-Blog*****************/

        composable("Home") {
            HomePage(navController, Modifier, pageViewModels.layoutViewModel)
        }


        /******************Resource*****************/
        composable("Resource") {
            ResourcePage(navController, Modifier, pageViewModels.layoutViewModel)
        }


        /******************Tools*****************/
        composable("Tools") {
            ToolsPage(navController, Modifier, pageViewModels.layoutViewModel)
        }
        composable("Tools/ToDoList") {
            ToDoList(navController, Modifier, pageViewModels.todoViewModel)
        }
        composable("Tools/Ble") {
            Ble(navController, Modifier)
        }
        composable("Tools/Calculator") {
            CalculatorPage(navController, Modifier, pageViewModels.calculatorViewModel)
        }

        /******************Self*****************/
        composable("Self") {
            SelfPage(navController, Modifier, pageViewModels.layoutViewModel)
        }
        composable("Self/Setting") {
            Setting(navController, Modifier)
        }

        /******************Test*****************/
        composable("Test") {
            TestPage(navController, Modifier)
        }
    }
}